package cn.jervain.nut.auth.core.storage;

import cn.jervain.nut.auth.core.exception.AuthException;
import cn.jervain.nut.auth.core.token.Token;

public interface TokenStorage<T> {

    /**
     * 存储Token，返回字符串标识
     * @param token
     * @return
     */
    default String put(Token token) {
        throw new UnsupportedOperationException();
    }

    /**
     * 根据字符串标识返回Token
     * @param sign
     * @return
     */
    default Token<T> get(String sign) throws AuthException {
        throw new UnsupportedOperationException();
    }

}
